ARG BASE_IMAGE=mcr.microsoft.com/dotnet/aspnet:9.0
FROM ${BASE_IMAGE}
RUN . /etc/os-release && \
    if [ "$ID" = "debian" ]; then \
        case "$VERSION_ID" in \
            "10"|"9"|"8") \
                sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list; \
                sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list; \
                ;; \
        esac; \
    fi

RUN apt update -y && apt install iputils-ping telnet curl procps wget libfontconfig1 fontconfig locales -y 
RUN locale-gen zh_CN.UTF-8

RUN wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O /etc/apt/sources.list.d/packages-microsoft-prod.deb
RUN dpkg -i /etc/apt/sources.list.d/packages-microsoft-prod.deb
RUN apt update -y && apt install dotnet-sdk-8.0 -y
RUN dotnet tool install --global dotnet-dump
ARG BASE_IMAGE=registry.cn-hangzhou.aliyuncs.com/zijian666/dotnet:sdk-5.0
ENV BASE_IMAGE=${BASE_IMAGE}
RUN mkdir -p /build_time \
    && echo "base image ${BASE_IMAGE} build time: $(date '+%Y-%m-%d %H:%M:%S')" > /build_time/aspnet-dev.txt
ONBUILD RUN cat /build_time/aspnet-dev.txt
CMD ["/bin/sh", "-c", "for f in /build_time/*.txt; do cat \"$f\"; done"]